package com.okonna.selenium.tide.workers;

import org.openqa.selenium.server.*;


public class RCServerWorker
{
    private SeleniumServer selRCServerWorker;
 
    public RCServerWorker(RemoteControlConfiguration selRCServerConfig)
    {
		try
		{
		    selRCServerWorker = new SeleniumServer(selRCServerConfig);
		}
		catch (Exception e)
		{
		    System.out.println("\nException:\n" + e + "\n");
		}
    }
    
    public void startServer() throws Exception 
    {
		System.out.println(this.getClass().getSimpleName() + ".startServer()");
		selRCServerWorker.start();
    }
    
    public void stopServer() throws Exception
    {
		System.out.println(this.getClass().getSimpleName() + ".stopServer()");
		selRCServerWorker.stop();
		selRCServerWorker = null;
    }
    
}
